home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -in_the_mag- / workbench / sql / sqldb / rexxmacros / sqltest5.rexx < prev   
OS/2 REXX Batch file  |  1999-06-29  |  684b  |  30 lines

  1. /* sqltest5.rexx */
  2. address 'SQLserver'
  3. options results
  4. 'ExecSQL' 'open table salesreps;'
  5. 'ExecSQL' "declare testcur cursor for select from salesreps where empl_num < 106;"
  6. 'ExecSQL' 'open testcur;'
  7. 'ExecSQL' 'fetch columns of testcur;'
  8. /*trace(results)*/
  9. say 'result = ' result
  10. 'GetLastCode'
  11. say 'sqlcode = ' result
  12. do forever
  13. /*   if result > 0
  14.     then say 'greater than zero'
  15.    if result = 0
  16.     then say 'equal to zero'
  17.    if result < 0
  18.     then say 'less than zero'
  19. */
  20.    if result ~= 0
  21.        then break
  22.    'ExecSQL' 'fetch next of testcur;'
  23.    say 'result = ' result
  24.    'GetLastCode'
  25.    say 'sqlca.sqlcode = ' result
  26. end
  27. 'ExecSQL' 'close testcur;'
  28. 'ExecSQL' 'close table salesreps;'
  29.  
  30.